7.2. Timing system commands
The following commands can be used if #define SYSTEM_TIME_SYNC is set in the
sysconfig.h file.
These commands can be entered from the serial port command line prompt or the telnet
command line prompt.
u The "u" command will give the system stats including
the NTP Control loop coefficients.
set ntp,ip_address
e.x. #set ntp,10.0.0.11
set sync,{none|NTP,Sync_interval,Pgain,Dgain}
e.x. #set sync,ntp,10,4,1
The first parameter sets the sync type.
"none" specifies that no synchronization will be performed.
This also excluded RTC clock sync. This is a method to check system drift.
"NTP" specifies that system time sync should be done via NTP using the NTP
server set. If no NTP server is defined, then time sync will be to the RTC.
The second parameter sets the sync interval at which the NTP server will be
contacted for a current time stamp. This parameter is specified in seconds.
The third parameter sets the Proportional Gain Coefficient for the Time Sync Control
Loop.
The fourth parameter sets the Differential Gain Coefficient for the Time Sync Control
Loop.
See the timesync.c source file on how these coefficients are used in the time sync
algorithm.
T Please note the upper case. The "T" command prints out the time sync values for
every time sync operation with the NTP server. This output is continuous until another
"T" command is entered. Typical output would be:
SYS: 1130456127.820, NTP: 1130456127.814, K: -10, S100ms: 4, SFinal: 4
The first two numbers are the local and NTP values for time.
The third number is the correction value that was applied to the local value in order to
sync with NTP.
The fourth number indicates how many time sync intervals were required to reach
below 100ms accuracy.
The fifth number indicates how many time sync intervals were required to reach the
final time sync value.
The fifth number requires a bit more of an explanation.
When the system first boots, or is reset, or loses sync, the timesync condition is
reset.
The timesync interval is started at 5 seconds and the system proceeds to
timesync.
Remember that "timesync" means <100ms offset from NTP.
After the system is synchronized, the timesync interval is doubled and the system
timesyncs again.
Then, the current timesync interval is compared against the final timesync interval.
If we reached the final value, we stop doubling our current value.
So, the fifth number refers to the "final timesync interval".